#
# Copyright (C) 2023
#
# Brick Yang <printfxxx@163.com>
#
# This program is free software. You can redistribute it and/or
# modify it as you like.
#

sb_incs = include_directories('common')

sb_kcflags = ['-I' + meson.current_source_dir() + '/core', '-I' + meson.current_source_dir() + '/common', '-include', 'compat.h']

sb_kenvs = kenvs
sb_kenvs.append('KCFLAGS', [mtrace_kcflags, sb_kcflags], separator: ' ')
if cfgs.get('qoriq') == true
	sb_kenvs.append('KCFLAGS', '-DQORIQ', separator: ' ')
endif
if cfgs.get('layerscape') == true
	sb_kenvs.append('KCFLAGS', '-DLAYERSCAPE', separator: ' ')
endif
if cfgs.get('sb.platform_time') == true
	sb_kenvs.append('KCFLAGS', '-DPLATFORM_TIME', separator: ' ')
endif

sb_deps = declare_dependency(include_directories: sb_incs, dependencies: mtrace_deps)

if cfgs.get('sb.core') == true
	subdir('core')
endif
if cfgs.get('sb.driver') == true
	subdir('driver')
endif
if cfgs.get('sb.cli') == true
	subdir('cli')
endif
